import 'package:flutter/material.dart';

class CheckSvipUtil {
  static bool checkUserIsSvip(BuildContext context, bool show) {
    if (show) {
      return true;
    } else {
      double screenWidth = MediaQuery.of(context).size.width;
      final controller = TextEditingController();
      showDialog(
          context: context,
          builder: (context) => AlertDialog(
                insetPadding: EdgeInsets.zero,
                contentPadding: EdgeInsets.zero,
                elevation: 0,
                shadowColor: Colors.transparent,
                backgroundColor: Colors.transparent,
                title: Text('不是svip'),
                // backgroundColor: Color.fromARGB(255, 255, 255, 255),
                content: SizedBox(
                  width: screenWidth, // 指定对话框宽度
                  child: TextField(
                    controller: controller,
                    decoration: InputDecoration(hintText: '请输入内容'),
                  ),
                ),
                actions: [
                  TextButton(
                    onPressed: () => {Navigator.pop(context)},
                    child: const Text('取消'),
                  ),
                  TextButton(
                    onPressed: () => Navigator.pop(context, controller.text),
                    child: const Text('确认'),
                  ),
                ],
              ));
      return false;
    }
  }
}
